package com.zhiyou.driving;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;

/**
 * Created by zhouyanchao on 2017/10/25.
 * Descr:
 */
public class Test {


	public static void main(String[] args) {

		LocalDate localDate = LocalDate.now();
		System.out.println(localDate);


		LocalDate localDate1 = LocalDate.of(2017,7,10);
		System.out.println(localDate1);

		System.out.println(localDate.isEqual(localDate1));

		localDate.plusMonths(5);

		System.out.println(localDate.plusMonths(-1));
		System.out.println(localDate);
	}

	public static void test(){
		LocalDate localDate = LocalDate.now();
		System.out.println(localDate);

		LocalDateTime localDateTime = LocalDateTime.now();
		System.out.println(localDateTime);

		LocalTime localTime = LocalTime.now();
		System.out.println(localTime);

		System.out.println(".....................................");

		//当前年月日
		System.out.println("year:"+localDate.getYear());
		System.out.println("month:"+localDate.getMonthValue());
		System.out.println("day:"+localDate.getDayOfMonth());

		//localDate.getMonth().length(localDate.isLeapYear())
		System.out.println("当月总天数："+localDate.lengthOfMonth());

		System.out.println(localDate.withDayOfMonth(1).getDayOfWeek().getValue());

		System.out.println("1号周几："+localDate.withDayOfMonth(1).getDayOfWeek().getValue());

	}

}
